# This repo gives an example on how to setup apt-pinning in Debian 8 (jessie)

This setup has following repositories enabled:
- oldstable
- oldstable backports
- stable
- stable backports
- testing
- unstable
- experimental
- mozilla (iceweasel-release)

These repositories are setup in a way, that allows you to stay on "stable", but gives you to option to grab newer/older packages, if needed.
You can find more information on that in the Debian-Wiki (See: https://wiki.debian.org/AptPreferences )

PREFER
- first priority: stable, stable-updates

ON DEMAND
- second priority: stable-backports
- third priority: oldtsbale, oldstable-updates, oldstable-backports
- fourth priority: testing, testing-updates

IF SPECIFIED
- fifth priority: unstable
- sixth priority: experimental


There are multiple ways of installing packages from a specific release:

1 - this one will install the package and all of its dependencies from the specified repository.
apt-get -t RELEASE install PACKAGE1 PACKAGE2 PACKAGE3
for example:
apt-get -t unstable install linux-image-amd64 iceweasel

2 - this one will try to install the package from the specified repository and follow your apt-pinning preferences for satisfying its dependencies
apt-get install PACKAGE1/RELEASE PACKAGE2/RELEASE PACKAGE3/RELEASE
for example:
apt-get install linux-image-amd64/testing iceweasel/unstable

You can also use APTITUDE instead of APT-GET, if you prefer it.

## How-To-Use

You need to replace your "/etc/apt/preferences" file with the one you can find here.
Additionally, place "sources.list.d" in the same folder (You may need to disable your repositories in "/etc/apt/sources.list")
> su -c "apt-get update" root
(or aptitude) will refresh your sources and you are good to go.
If you have "sudo" installed, you can do:
> sudo apt-get update

*NOTE: The repositories in my "sources.list.d" are pointed towards the german servers. You should replace them with your location's mirror. You can find a list [on the Debian-Wiki](https://www.debian.org/mirror/list).*
